﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Routing;
using System.Web.Mvc.Html;
using System.Data;
using Newtonsoft.Json;
using System.Runtime.Serialization.Json;
using System.Text;
using System.IO;
using System.Web.UI;
using ScriptSharp.Web;
using System.Web.Script.Serialization;


namespace MCPro.Mvc
{
    public static class Helpers
    {
        public static HtmlString ImageActionLink(this AjaxHelper ajaxHelper, string imageUrl, string height, string width, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)
        {
            var repID = Guid.NewGuid().ToString();
            var lnk = ajaxHelper.ActionLink(repID, actionName, controllerName, routeValues, ajaxOptions, htmlAttributes);
            var image = "<img src='" + imageUrl + "' alt='" + repID + "' height='" + height + "' width='" + width + "' />";
            HtmlString html = new HtmlString(lnk.ToString().Replace(repID, image));
            return html;
        }
    }
}